package projectwork.shchuangge.cn.com.newproject.adapter;

import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by 赵航 on 2017/6/19.
 */

public class MyHomeAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> mFragmentList;
    private List<String> mStrings;

    public MyHomeAdapter(FragmentManager fm,List<Fragment> fragmentList,List<String > strings) {
        super(fm);
        this.mFragmentList = fragmentList;
        this.mStrings = strings;

    }

    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList==null?0:mFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
//        return super.getPageTitle(position);
        return mStrings.get(position);
    }
}
